package com.juc.executors.executors5;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Run {

	/**
	 * newFixedThreadPool(3)
	 * 创建的是有界线程池 也就是池中的线程个数可以指定最大数量
	 */
	public static void main(String[] args) {
		ExecutorService executorService = Executors.newFixedThreadPool(3);
		for (int i = 0; i < 3; i++) {
			executorService.execute(new MyRunable(""+ (i+1)));
		}
		for (int i = 0; i < 3; i++) {
			executorService.execute(new MyRunable(""+ (i+1)));
		}
	}
}
